x = ['a', 'abc', 'ab', 'abcd']
dict1 = {len(i): i for i in x}
print(dict1)
